Fix config precedence: respect local configuration in multi-blueprint workflows#170
Merged
sellakumaran merged 3 commits intomainfrom Feb 7, 2026
Merged
Conversation
Co-authored-by: sellakumaran <147754920+sellakumaran@users.noreply.github.com>
Co-authored-by: sellakumaran <147754920+sellakumaran@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix A365 CLI to respect local configuration for blueprints
Fix config precedence: respect local configuration in multi-blueprint workflows
Jan 22, 2026
sellakumaran
approved these changes
Jan 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a critical configuration precedence issue where the CLI was unconditionally syncing state to the global directory, causing configuration from different projects to overwrite each other. The fix modifies ConfigService.SaveStateAsync() to enforce proper precedence by saving state locally when in a project directory (identified by the presence of a365.config.json) and only using the global directory when running outside a project context.
Changes:
- Modified
SaveStateAsyncto check for local static config presence before deciding where to save state - Added logic to save state locally only when in a project directory, preventing cross-contamination
- Added two comprehensive tests verifying local-only and global-only save behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Microsoft.Agents.A365.DevTools.Cli/Services/ConfigService.cs | Implemented conditional save logic based on presence of local static config file |
| src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Services/Agent365ConfigServiceTests.cs | Added tests for local-only save (with static config) and global-only save (without static config) |
src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Services/Agent365ConfigServiceTests.cs
Show resolved
Hide resolved
src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Services/Agent365ConfigServiceTests.cs
Show resolved
Hide resolved
mengyimicro
approved these changes
Jan 24, 2026
joratz
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SaveStateAsyncunconditionally synced to global directory (%LOCALAPPDATA%\Microsoft.Agents.A365.DevTools.Cli), causing state from different projects to overwrite each other. Users working with multiple blueprints had to manually delete global config between context switches.Changes
Modified
ConfigService.SaveStateAsync()to enforce proper precedence:a365.config.json): Save state locally only, no global syncImplementation
Tests
Added verification for:
Impact
Enables independent configuration per project without manual cleanup. Global directory now serves its intended purpose: portability for non-project CLI invocations.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
graph.microsoft.com/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli rest --method GET --url REDACTED$filter=appId eq 'a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6'&$select=id --headers Authorization=Bearer fake-token-123(dns block)/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli rest --method GET --url REDACTED$filter=appId eq 'a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6'&$select=id --headers Authorization=Bearer fake-token-123 e.cs ator.cs e.cs�� Locator.cs onsoleFormatter.cs(dns block)/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli rest --method PATCH --url REDACTED --headers Content-Type=application/json Authorization=Bearer fake-token-123 --body {"publicClient":{"redirectUris":["http://localhost","http://localhost:8400/","ms-appx-web://microsoft.aad.brokerplugin/a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6"]}}(dns block)login.microsoftonline.com/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli login --tenant 12345678-1234-1234-1234-123456789012(dns block)Co-authored-by: sellakumaran <147754920+sellakumaran@users.noreply.github.com> = get && echo "password=$GITHUB_TOKEN"; }; f` (dns block)
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.